﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DGRobot
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            LogHelper.Log("--------------- 启动系统 ---------------");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ApplicationExit += Application_ApplicationExit;
            Application.ThreadException += Application_ThreadException;
            var form = new SelectServiceFrm();
            //form.SetPdfPath(new FileInfo("1.pdf").FullName);
            Application.Run(form);
            LogHelper.Log("--------------- 系统退出 ---------------");
        }

        private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            LogHelper.Log("出错\t"+e.Exception.Message);
        }

        private static void Application_ApplicationExit(object sender, EventArgs e)
        {
            
            RobotDriver.Instance.Dispose();
        }
    }
}
